refactor: remove support for styled-components from Primer #6856
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #
This pull request removes support for the deprecated
Boxcomponent and thesxprop from the main@primer/reactpackage, along with all related dependencies and code. These features have been migrated to the new@primer/styled-reactpackage, which now contains all styled-system and styled-components functionality. This change streamlines the main package, eliminates legacy styling APIs, and ensures that styled-system features are only available in the dedicated package.Migration of styled-system and styled-components functionality to
@primer/styled-react:styled-system,styled-components, and their Babel plugins/types have been removed frompackages/react/package.json, and added topackages/styled-react/package.json. [1] [2] [3] [4] [5] [6] [7] [8]styled-componentshas been removed frompackages/react/babel.config.jsand added topackages/styled-react/rollup.config.js. [1] [2]Boxcomponent and all related exports, types, and stories have been removed from@primer/reactand added to@primer/styled-react. This includes removal fromsrc/index.ts, deletion ofBox.docs.json,Box.stories.tsx,Box.features.stories.tsx, and internal fallback logic. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]sxutility and its types have been removed from@primer/reactand added to@primer/styled-react. [1] [2] [3] [4] [5]Build and script changes:
@primer/reactto@primer/styled-react, and related build scripts have been updated accordingly. [1] [2] [3] [4] [5]Cleanup of deprecated documentation and stories:
Boxcomponent have been removed from the main package. [1] [2] [3]Export changes:
Box,sx, and their types have been removed from@primer/reactand added to@primer/styled-react. [1] [2] [3] [4] [5] [6]This migration fully separates styled-system and styled-components usage into the new
@primer/styled-reactpackage, simplifying the main package and making future maintenance easier.Changelog
New
Changed
Removed
Rollout strategy
Testing & Reviewing
Merge checklist